import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import Footer from '@/components/Footer'
import hearder from '@/components/hearder'
import image from '@/components/image/image'
import home from '@/components/home/home'
import News from '@/components/News/News'
import HomeNews from '@/components/home/HomeNews'
import TranSport from '@/components/transportation/TranSport'
import Facilities from '@/components/Facilities/Facilities'
import PerFormance from '@/components/PerFormance/PerFormance'
import Login from '@/components/Contact/Login'
import Register from '@/components/Contact/Register'
import NewMessage from '@/components/NewMessage/NewMessage'
import New from '@/components/NewMessage/New'
import Dinnerlist from '@/components/Dinner/Dinnerlist'
Vue.use(Router)
const originalPush = Router.prototype.push
Router.prototype.push = function push(location, onResolve, onReject) {
  if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject)
  return originalPush.call(this, location).catch(err => err)
}


export default new Router({
  mode: 'history',
  routes: [
    {
      path: '/',
      name: 'HelloWorld',
      component: HelloWorld,

    },

    {
      path: '/Footer',
      name: 'Footer',
      component: Footer
    },
    {
      path: '/hearder',
      name: 'hearder',
      component: hearder
    },
    {
      path: '/image',
      name: 'image',
      component: image
    }, {
      path: '/home',
      name: 'home',
      component: home
    },
    {
      path: '/News',
      name: 'News',
      component: News
    },
    {
      path: '/HomeNews',
      name: 'HomeNews',
      component: HomeNews
    },
    {
      path: '/TranSport',
      name: 'TranSport',
      component: TranSport
    },
    {
      path: '/Facilities',
      name: 'Facilities',
      component: Facilities
    },
    {
      path: '/PerFormance',
      name: 'PerFormance',
      component: PerFormance
    },
    {
      path: '/Login',
      name: 'Login',
      component: Login
    },
    {
      path: '/Register',
      name: 'Register',
      component: Register
    },
    {
      path: '/NewMessage',
      name: 'NewMessage',
      component: NewMessage
    },
    {
      path: '/New',
      name: 'New',
      component: New, 
      meta: {
        requireAuth: true
      }
    },
    {
      path: '/Dinnerlist',
      name: 'Dinnerlist',
      component: Dinnerlist
    }
  ]
})
